package com.turing.data.scripts.contract.transfer

import com.turing.data.vo.out.review.DependParamsVO
import com.turing.data.vo.out.review.TaskElementVO


class IfTemporaryOpenFrequency_30186_10_transfer {

    static List< TaskElementVO.DrawResultVO > doConvert(List< TaskElementVO.DrawResultVO > resultVOs, DependParamsVO dependParams){

        for( drawResultVO in resultVOs ) {
                def childTaskSn = drawResultVO.childTaskSn
                if(null == childTaskSn || childTaskSn == ""){
                    continue
                }
            String modelValue = drawResultVO.text
            String REGEX_NOT_EXPLAIN = /.*不.*/
            String REGEX_EXPLAIN_1 = /.*临时开放.*/
            String REGEX_EXPLAIN_2 = /.*设置开放.*/
            String REGEX_IS = /.*是.*/
            String str = modelValue.replaceAll("\n", "").replaceAll("\r", "")
            if(str =~ REGEX_NOT_EXPLAIN){
                drawResultVO.businessValue ="否"
                drawResultVO.type = 1
            }else if (str =~ REGEX_EXPLAIN_1 || str =~ REGEX_EXPLAIN_2 || str =~ REGEX_IS ) {
                drawResultVO.businessValue = "是"
                drawResultVO.type = 1
            }else{
                drawResultVO.businessValue ="否"
                drawResultVO.type = 1
            }
        }

        return resultVOs
    }

}
